
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ApusicPackage;
import Apusic.JVM;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>JVM</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.JVMImpl#getVmVersion <em>Vm Version</em>}</li>
 *   <li>{@link Apusic.impl.JVMImpl#getVmVendor <em>Vm Vendor</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class JVMImpl extends WrappingEObjectImpl implements JVM
{
  /**
   * The default value of the '{@link #getVmVersion() <em>Vm Version</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVmVersion()
   * @generated
   * @ordered
   */
  protected static final String VM_VERSION_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getVmVersion() <em>Vm Version</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVmVersion()
   * @generated
   * @ordered
   */
  protected String vmVersion = VM_VERSION_EDEFAULT;

  /**
   * The default value of the '{@link #getVmVendor() <em>Vm Vendor</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVmVendor()
   * @generated
   * @ordered
   */
  protected static final String VM_VENDOR_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getVmVendor() <em>Vm Vendor</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getVmVendor()
   * @generated
   * @ordered
   */
  protected String vmVendor = VM_VENDOR_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected JVMImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.JVM;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    result=true;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    VMConfig core=(VMConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getVmVersion()
  {
        Object result=null;
        VMConfig core=(VMConfig)getCore();
        if(core==null) return vmVersion;	
        try
{
vmVersion=core.getVmVersion();
}
catch(Exception e)
{
  vmVersion = null;
}
    return vmVersion; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setVmVersion(String newVmVersion)
  {
    String oldVmVersion = vmVersion;
    vmVersion = newVmVersion;
        	
      VMConfig core=(VMConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JVM__VM_VERSION, oldVmVersion, vmVersion));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getVmVendor()
  {
        Object result=null;
        VMConfig core=(VMConfig)getCore();
        if(core==null) return vmVendor;	
        try
{
vmVendor=core.getVmVendor();
}
catch(Exception e)
{
  vmVendor = null;
}
    return vmVendor; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setVmVendor(String newVmVendor)
  {
    String oldVmVendor = vmVendor;
    vmVendor = newVmVendor;
        	
      VMConfig core=(VMConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.JVM__VM_VENDOR, oldVmVendor, vmVendor));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.JVM__VM_VERSION:
        return getVmVersion();
      case ApusicPackage.JVM__VM_VENDOR:
        return getVmVendor();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.JVM__VM_VERSION:
        setVmVersion((String)newValue);
        return;
      case ApusicPackage.JVM__VM_VENDOR:
        setVmVendor((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.JVM__VM_VERSION:
        setVmVersion(VM_VERSION_EDEFAULT);
        return;
      case ApusicPackage.JVM__VM_VENDOR:
        setVmVendor(VM_VENDOR_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.JVM__VM_VERSION:
        return VM_VERSION_EDEFAULT == null ? vmVersion != null : !VM_VERSION_EDEFAULT.equals(vmVersion);
      case ApusicPackage.JVM__VM_VENDOR:
        return VM_VENDOR_EDEFAULT == null ? vmVendor != null : !VM_VENDOR_EDEFAULT.equals(vmVendor);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (vmVersion: ");
    result.append(vmVersion);
    result.append(", vmVendor: ");
    result.append(vmVendor);
    result.append(')');
    return result.toString();
  }

} //JVMImpl
